<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html,body{
            width: 100%;
            height: 100%;
            margin: 0;
            overflow: hidden;
        }
        .dialog{
            height: 100%;
            width: 100%;
            /* opaity 0~1 包含0和1
            具有继承性,父盒子设置透明度,子盒子也具有透明度 */
            /* opacity: 0.3;
            background-color: black; */
            background-color: rgba(0, 0, 0, 0.3);
            position: absolute;
            left: 0;
            top: 0;
        }
        .login{
            width: 400px;
            height: 350px;
            background-color: white;
            position: absolute;
            /* 到盒子中间去 */
            left: 50%;
            top: 50%;
            /* 移动自身的一半 */
            transform: translate(-50%,-50%);
            /* 子盒子使用opacity不好使 */
        }
    </style>
</head>
<body>
    <div class="dialog">
        <div class="login">
            <input type="text" placeholder="用户名">
            <input type="text" placeholder="密码">
            <button>登录</button>
        </div>
    </div>
    <button>登录场馆后,才能点击我</button>
</body>
</html>